<?php

/**
 * Subclass for representing a row from the 'contents' table.
 *
 *
 *
 * @package lib.model
 */
class Contents extends BaseContents{

    public function getTh($content_id){

        $c = new Criteria;

        switch($content_id){

            case "1":
                $arr_field_name = VwOnePeer::getFieldNames();
                array_shift($arr_field_name);
                unset($arr_field_name[0]);

                return $arr_field_name;
                break;

            case "2":
                $arr_field_name = VwTwoJeunoPeer::getFieldNames();
                array_shift($arr_field_name);
                unset($arr_field_name[0]);

                return $arr_field_name;
                break;

            case "3":
                $arr_field_name = VwZilartPeer::getFieldNames();
                array_shift($arr_field_name);
                unset($arr_field_name[0]);

                return $arr_field_name;
                break;

            case "4":
                $arr_field_name = VwThreePeer::getFieldNames();
                array_shift($arr_field_name);
                unset($arr_field_name[0]);

                return $arr_field_name;
                break;

        }
    }

    static function getDat($content_id, $member_id){

        $c = new Criteria;

        switch($content_id){
            case "1":
                $c->add(VwOnePeer::MEMBER_ID, $member_id);
                $arr_obj = VwOnePeer::doSelect($c);

                $y = 0;
                $arr = array();

                foreach($arr_obj as $v){
                    $val = (array)$v;

                    for($x=0; $x<2; $x++){
                        array_shift($val);
                    }
                    for($x=0; $x<6; $x++){
                        array_pop($val);
                    }
                    foreach($val as $va){
                        $arr[$y][] = $va;
                    }
                    $y++;
                }

                return $arr;
                break;

            case "2":
                $c->add(VwTwoJeunoPeer::MEMBER_ID, $member_id);
                $arr_obj = VwTwoJeunoPeer::doSelect($c);

                $y = 0;
                $arr = array();

                foreach($arr_obj as $v){
                    $val = (array)$v;

                    for($x=0; $x<2; $x++){
                        array_shift($val);
                    }
                    for($x=0; $x<6; $x++){
                        array_pop($val);
                    }
                    foreach($val as $va){
                        $arr[$y][] = $va;
                    }
                    $y++;
                }

                return $arr;
                break;

            case "3":
                $c->add(VwZilartPeer::MEMBER_ID, $member_id);
                $arr_obj = VwZilartPeer::doSelect($c);

                $y = 0;
                $arr = array();

                foreach($arr_obj as $v){
                    $val = (array)$v;

                    for($x=0; $x<2; $x++){
                        array_shift($val);
                    }
                    for($x=0; $x<6; $x++){
                        array_pop($val);
                    }
                    foreach($val as $va){
                        $arr[$y][] = $va;
                    }
                    $y++;
                }

                return $arr;
                break;

            case "4":
                $c->add(VwThreePeer::MEMBER_ID, $member_id);
                $arr_obj = VwThreePeer::doSelect($c);

                $y = 0;
                $arr = array();

                foreach($arr_obj as $v){
                    $val = (array)$v;

                    for($x=0; $x<2; $x++){
                        array_shift($val);
                    }
                    for($x=0; $x<6; $x++){
                        array_pop($val);
                    }
                    foreach($val as $va){
                        $arr[$y][] = $va;
                    }
                    $y++;
                }

                return $arr;
                break;

        }
    }
}